# eric7.Project.QuickFindFileDialog

Module implementing a quick search for files.

This is basically the FindFileNameDialog modified to support faster interactions.

### Global Attributes

None

### Classes

QuickFindFileDialog | Class implementing the Quick Find File by Name Dialog.

### Functions

None

## QuickFindFileDialog

Class implementing the Quick Find File by Name Dialog.

This dialog provides a slightly more streamlined behaviour than the standard FindFileNameDialog in that it tries to match any name in the project against (fragmentary) bits of file names.

### Signals

designerFile(str)
  emitted to open a Qt-Designer file
linguistFile(str)
  emitted to open a Qt translation file
sourceFile(str)
  emitted to open a file in the editor

### Derived from

QWidget, Ui_QuickFindFile

### Class Attributes

None

### Class Methods

None

### Methods

QuickFindFileDialog | Constructor
__generateLocations | Private method to generate a set of locations that can be searched.
__openFile | Private slot to open a file.
__searchFile | Private slot to handle the search.
__sortedMatches | Private method to find the subset of items which match a search term.
eventFilter | Public method to handle event for another object.
on_buttonBox_clicked | Private slot called by a button of the button box clicked.
on_fileList_currentItemChanged | Private slot handling a change of the current item.
on_fileList_itemActivated | Private slot to handle the double click on a file item.
on_fileNameEdit_returnPressed | Private slot to handle enter being pressed on the file name edit box.
on_fileNameEdit_textChanged | Private slot to handle the textChanged signal of the file name edit.
show | Public method to perform actions before showing the dialog.

### Static Methods

None

#### QuickFindFileDialog (Constructor)

QuickFindFileDialog(project, parent=None)

Constructor

project (Project)
  reference to the project object
parent (QWidget)
  parent widget of this dialog

#### QuickFindFileDialog.__generateLocations

__generateLocations()

Private method to generate a set of locations that can be searched.

Yield:
  set of files in our project

Yield Type:
  str

#### QuickFindFileDialog.__openFile

__openFile(itm=None)

Private slot to open a file.

It emits the signal sourceFile or designerFile depending on the file extension.

itm (QTreeWidgetItem)
  item to be opened

Return:
  flag indicating a file was opened

Return Type:
  bool

#### QuickFindFileDialog.__searchFile

__searchFile()

Private slot to handle the search.

#### QuickFindFileDialog.__sortedMatches

__sortedMatches(items, searchTerm)

Private method to find the subset of items which match a search term.

items (list of str)
  list of items to be scanned for the search term
searchTerm (str)
  search term to be searched for

Return:
  sorted subset of items which match searchTerm in relevance order (i.e. the most likely match first)

Return Type:
  list of tuple of bool, int and str

#### QuickFindFileDialog.eventFilter

eventFilter(source, event)

Public method to handle event for another object.

source (QObject)
  object to handle events for
event (QEvent)
  event to handle

Return:
  flag indicating that the event was handled

Return Type:
  bool

#### QuickFindFileDialog.on_buttonBox_clicked

on_buttonBox_clicked(button)

Private slot called by a button of the button box clicked.

button (QAbstractButton)
  button that was clicked

#### QuickFindFileDialog.on_fileList_currentItemChanged

on_fileList_currentItemChanged(current, _previous)

Private slot handling a change of the current item.

current (QTreeWidgetItem)
  current item
_previous (QTreeWidgetItem)
  prevoius current item (unused)

#### QuickFindFileDialog.on_fileList_itemActivated

on_fileList_itemActivated(itm, _column)

Private slot to handle the double click on a file item.

It emits the signal sourceFile or designerFile depending on the file extension.

itm (QTreeWidgetItem)
  the double clicked listview item
_column (int)
  column that was double clicked (unused)

#### QuickFindFileDialog.on_fileNameEdit_returnPressed

on_fileNameEdit_returnPressed()

Private slot to handle enter being pressed on the file name edit box.

#### QuickFindFileDialog.on_fileNameEdit_textChanged

on_fileNameEdit_textChanged(text)

Private slot to handle the textChanged signal of the file name edit.

text (str)
  (ignored)

#### QuickFindFileDialog.show

show(isRemote)

Public method to perform actions before showing the dialog.

isRemote (bool)
  flag indicating a remote project

Up